package com.xinqi.modules.discuss.discuss.client;


import com.xinqi.common.base.constants.ServiceNameConstants;
import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.discuss.discuss.dto.req.CourseDiscussCreateDTO;
import com.xinqi.modules.discuss.discuss.dto.req.CourseDiscussQueryDTO;
import com.xinqi.modules.discuss.discuss.dto.req.CourseDiscussUpdateDTO;
import com.xinqi.modules.discuss.discuss.dto.rsp.CourseDiscussResultDTO;
import com.xinqi.modules.discuss.discuss.factory.CourseDiscussFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 课程讨论主表客户端
 *
 * @author: wenjie
 * @date: 2023/10/30
 */
@FeignClient(value = ServiceNameConstants.XQ_DISCUSS, fallbackFactory = CourseDiscussFallbackFactory.class)
public interface CourseDiscussClient {


    /**
     * 课程讨论主表-详情
     */
    @GetMapping("/inner/course-discuss/{id}")
    R<CourseDiscussResultDTO> findById(@PathVariable("id") Long id);

    /**
     * 评论参与
     */
    @PostMapping("/inner/course-discuss/participate")
    R<Void> participate(@RequestParam("classId") Long classId, @RequestParam("contentId") Long contentId, @RequestParam("userId") Long userId);

    /**
     * 修改课程讨论主表
     */
    @PutMapping("/inner/course-discuss/{id}")
    public R<Boolean> update(@PathVariable("id") Long id, @RequestBody CourseDiscussUpdateDTO dto);

    /**
     * 班级添加成员 -- 讨论同步
     */
    @PostMapping("/inner/course-discuss/class-add-members")
    R<Boolean> classAddMembers(@RequestParam("classId") Long classId, @RequestParam("userId") Long userId);

}
